package process

import (
	"regexp"
	"strings"
)

var skipList = make(map[string]byte)

func init() {
	const s = "how,best,my,for,like,get,and,is,/,to,it,do,at,the,you"
	var skips = strings.Split(s, ",")

	for _, s := range skips {
		skipList[s] = 0x01
	}
}

// skipWordsFilter 过滤掉一些关键词, true:需要过滤, false:不在过滤数据库
func skipWordsFilter(s string) bool {
	_, ok := skipList[s]
	return ok
}
func numberFilter(s string) bool {
	match, err := regexp.Match("^\\d+$", []byte(s))
	if err != nil {
		return false
	}
	return match
}

func emptyFilter(s string) bool {
	return len(s) == 0
}
